package main

import (
	"encoding/json"
	"io/ioutil"
	"log"
)

type Config struct {
	UserName     string `json:"user_name"`
	SchoolNumber string `json:"school_number"`
	Mail string `json:"mail"`
	MailPassword string `json:"mail_password"`
	Host string `json:"host"`
	Port string `json:"port"`
}

func (c *Config) GetConf() *Config  {
	jsonFile,err:=ioutil.ReadFile("config.json")
	if err!=nil{
		log.Printf("configFile.Get err #%v",err)
	}
	err = json.Unmarshal(jsonFile,c)
	if err!=nil{
		log.Printf("Unmarshal err #%v",err)
	}
	return c
}